$import( "SmitearWebGL.Objects.Parser.Collada.DaeEntity" );
$import( "SmitearWebGL.Objects.Parser.Collada.DaeAddressSyntax" );

SmitearWebGL.Objects.Parser.Collada.DaeChannel = SmitearWebGL.Objects.Parser.Collada.DaeEntity.extend(
{
	/******** constructor ********/

	init : function( document, node )
	{
		this.source = "";
		this.target = "";
		this.syntax = null;
		this.sampler = null;

		this._super( document, node );
		this._registClass( "SmitearWebGL.Objects.Parser.Collada.DaeChannel" );
	}
	,
	read : function( node )
	{
		$THROW( node.localName == SmitearWebGL.Objects.Parser.Collada.Const.DAE_CHANNEL_ELEMENT,
		"expected a '" + SmitearWebGL.Objects.Parser.Collada.Const.DAE_CHANNEL_ELEMENT + "' element" );

		this._super( node );

		this.source = this.getAttribute(node, SmitearWebGL.Objects.Parser.Collada.Const.DAE_SOURCE_ATTRIBUTE);
		this.target = this.getAttribute(node, SmitearWebGL.Objects.Parser.Collada.Const.DAE_TARGET_ATTRIBUTE);

		this.syntax = SmitearWebGL.Objects.Parser.Collada.DaeAddressSyntax.parse( this.target );
	}
}
);